import { request } from '@/service/request';
import type { ClientSearchParams, ClientVO, Open } from '@/service/types/open';

export function getPageList(params?: ClientSearchParams) {
  return request<Open.ClientVo>({
    url: '/system/client/list',
    method: 'get',
    params
  });
}

export function getClient(id: number) {
  return request<ClientVO>({
    url: `/system/client/${id}`,
    method: 'get'
  });
}

export function addClient(data: ClientVO) {
  return request({
    url: '/system/client',
    method: 'post',
    data
  });
}

export function editClient(data: ClientVO) {
  return request({
    url: '/system/client',
    method: 'put',
    data
  });
}

export function delClient(id: number) {
  return request({
    url: `/system/client/${id}`,
    method: 'delete'
  });
}
